fix(maintenance): import DEFAULT variant so experiment starter restore works (#36337)#36362
Conversation
… validation (#36337) On a fresh install the starter import (Task00004LoadStarter, MainServlet line 129) runs before DefaultVariantInitializer (line 218), and postgres.sql does not seed the DEFAULT variant row. Every experiment's trafficProportion references the DEFAULT variant, so building the Experiment model during import triggers AbstractTrafficProportion's @Value.Check, which fails variant-existence validation ("Invalid Variants provided") and aborts startup. The variant import branch was explicitly skipping DEFAULT. Import it from the starter instead (the existence guard still prevents PK duplicates and is a no-op when the initializer already created it). With DEFAULT and the experiment variants present before experiments deserialize, the model builds and ExperimentsFactory.save works as intended. Follow-up to #36339. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… version** - Updated all occurrences of `CUSTOM_STARTER_URL` in `docker-compose.yml`, `README.md`, and related files to reference the latest starter version (`20260629`). - Ensured consistency across various environments, including single-node, cluster-mode, Redis, OpenSearch, push-publish, and manual setup examples. - Adjusted sample configuration files and documentation to reflect the updated URL for better initialization during deployments. ref: #36337 Signed-off-by: erickgonzalez <erick.gonzalez@dotcms.com>
|
Claude finished @erickgonzalez's task in 1m 7s —— View job Rollback Safety Analysis
Result: ✅ Safe to Roll BackThe label AnalysisThe PR contains two logical changes. Neither matches any rollback-unsafe category. 1. The change removes a special-case
2. All changes are documentation and configuration reference updates — URLs in comments or example YAML files pointing at a newer starter artifact ( Quick-reference check against all categories:
|
🤖 dotBot Review (Bedrock)Reviewed 26 file(s); 2 candidate(s) → 2 confirmed, 0 uncertain (unverified, kept for review). Confirmed findings
us.deepseek.r1-v1:0 · Run: #28405946285 · tokens: in: 65646 · out: 13496 · total: 79142 · calls: 32 · est. ~$0.162 |
|
@claude create a description for this PR |
|
Claude finished @erickgonzalez's task in 39s —— View job Tasks
PR Descriptionfix(maintenance): import DEFAULT variant so experiment starter restore works SummaryFixes a fatal startup error when restoring a starter that contains A/B experiments. Before this fix, booting from such a starter would abort with: Root CauseThere is an initialization ordering gap in
Every experiment's FixStop skipping The fix stays entirely within Also IncludedBumps Changed Files
How to Test
|
|
Tick the box to add this pull request to the merge queue (same as
|
Proposed Changes
Follow-up to #36339 (export/import of Experiments and Variants in the starter).
Manual round-trip testing surfaced a fatal error when importing a starter that contains experiments — startup aborts with:
Root cause
On a fresh install the starter import runs in
MainServlet.init()at line 129 (executeStartUpTasks()→Task00004LoadStarter→ImportStarterUtil), while theDEFAULTvariant is created later at line 218 (DotInitializationService→DefaultVariantInitializer).postgres.sqldoes not seed theDEFAULTvariant row, and the run-once upgrade tasks don't run on this path.Every experiment's
trafficProportionreferences theDEFAULTvariant. Building theExperimentimmutable during import triggersAbstractTrafficProportion's@Value.Check, which validates that every referenced variant exists viaVariantAPI.get(...). Because the import branch was explicitly skipping theDEFAULTvariant, it was absent at deserialize time → validation fails → startup is aborted.Fix
Stop skipping
DEFAULTin the variant import branch — import it from the starter like any other variant. The existingvariantFactory.get(name).isPresent()guard still prevents PK duplicates and makes it a no-op when the initializer already created the row. WithDEFAULT(and the experiment variants) present before experiments deserialize, the model builds andExperimentsFactory.save()works as designed.This keeps the factory-based import (no raw SQL) and changes only
ImportStarterUtil.Also included
fix(docker): bumpCUSTOM_STARTER_URLreferences to the latest starter version (20260629) across docker-compose examples and docs, so deployments initialize from a starter that exercises this path.How to Test
_downloadStarter/_downloadStarterWithAssets).CUSTOM_STARTER_URL) and boot it.Invalid Variants provided), and the experiment + its variants are present and open correctly in the UI.🤖 Generated with Claude Code
This PR fixes: #36337
This PR fixes: #36337